package com.chase.passwordmaster.components.immersegroup

import android.content.Context
import android.util.AttributeSet
import android.widget.FrameLayout

/**
 * 沉浸式状态栏Toolbar辅助类
 * 避免Toolbar设置fitSystemWindows="true"当软键盘弹出时Toolbar被拉伸
 */
class ImmerseGroup : FrameLayout {
    constructor(context: Context) : super(context)
    constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
    constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    )

    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        setPadding(paddingLeft, paddingTop, paddingRight, 0)
        super.onMeasure(widthMeasureSpec, heightMeasureSpec)
    }
}